---
title: "TypeScript Custom Application"
sidebar_label: "TypeScript"
slug: /extending/custom-applications/typescript
description: "Learn how to extend Dagger by embedding it into your own TypeScript applications, enabling custom workflows and integrations."
---




:::note
The Dagger TypeScript SDK requires [TypeScript 5.0 or later](https://www.typescriptlang.org/download/). This SDK currently only supports Node.js (stable) and Bun (experimental). To execute the TypeScript program, you must also have an TypeScript executor like `ts-node` or `tsx`.
:::

Install the Dagger TypeScript SDK in your project using `npm` or `yarn`:

```shell
// using npm
npm install @dagger.io/dagger@latest --save-dev

// using yarn
yarn add @dagger.io/dagger --dev
```

This example demonstrates how to test a Node.js application against multiple Node.js versions using the TypeScript SDK.

Create an example React project (or use an existing one) in TypeScript:

```shell
npx create-react-app my-app --template typescript
cd my-app
```

In the project directory, create a new file named `build.mts` and add the following code to it:

```typescript file=./snippets/clients-sdk/typescript/build.mts
```

This TypeScript program imports the Dagger SDK and defines an asynchronous function. This function creates a Dagger client, which provides an interface to the Dagger API. It also defines the test/build matrix, consisting of Node.js versions `16`, `18` and `20`, and iterates over this matrix, downloading a Node.js container image for each specified version and testing and building the source application against that version.

Run the program with a Typescript executor like `ts-node`, as shown below:

```shell
dagger run node --loader ts-node/esm ./build.mts
```

The `dagger run` command executes the specified command in a Dagger session and displays live progress. The program tests and builds the application against each version in sequence. At the end of the process, a built application is available for each Node.js version in a `build-node-XX` folder in the project directory, as shown below:

```shell
tree -L 2 -d build-*
build-node-16
└── static
    ├── css
    ├── js
    └── media
build-node-18
└── static
    ├── css
    ├── js
    └── media
build-node-20
└── static
    ├── css
    ├── js
    └── media
```
